package PTA_5;

import java.util.Arrays;
import java.util.Scanner;
class NumberFormatException extends Exception {
	public NumberFormatException(String x) {
		System.out.println("java.lang.NumberFormatException: For input string: "+"\""+x+"\"");
	}
}
class t6 {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] arr = new int[n];
		int k = 0;
		while(k < n) {
			for(int i = 0;i < n;) {
				String x = scan.next();
				try {
					if(!x.matches("\\d+")) {
						throw new NumberFormatException(x);
					} else {
						arr[i] = Integer.parseInt(x);
						k++;
						i++;
					}
				} catch(NumberFormatException e) {
					
				}
			}
			System.out.println(Arrays.toString(arr));
		}
	}
}
